package ru.aptu.billing_message;

/**
 * Created by IntelliJ IDEA.
 * User: andrey
 * Date: 12/23/11
 * Time: 12:29 AM
 */
public class RequestMessage extends BasicMessage {

    protected ServiceType serviceType;

    protected String accID;

    public RequestMessage(MessageType msgType, ServiceType serviceType, String accID) {
        super(MessageDirection.REQUEST, msgType);
        this.msgID = currentID++;
        this.serviceType = serviceType;
        this.accID = accID;
    }

    public RequestMessage(MessageType msgType) {
        super(MessageDirection.REQUEST, msgType);
        this.msgID = currentID++;
        this.serviceType = ServiceType.EMPTY;
        this.accID = "";
    }

    public ServiceType getServiceType() {
        return serviceType;
    }

    public String getAccID() {
        return accID;
    }

    public boolean isServiceCredit() {
        return (serviceType.equals(ServiceType.WATER) || serviceType.equals(ServiceType.ELECTRICITY));
    }
}
